<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddSubjectToPayHistoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('open_shop_sign_order_pay_history', function (Blueprint $table) {
            $table->string('subject', 64)->default('')->comment('备注')->after('type');
        });

        \App\Models\OpenShop\InvestmentPromotion\OpenShopSignOrderPayHistoryModel::query()
                                                                                 ->update(['subject' => '加盟费']);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('open_shop_sign_order_pay_history', function (Blueprint $table) {
            $table->dropColumn('subject');
        });
    }
}
